package net.solvetheriddle.wwclient.view;

import net.solvetheriddle.wwclient.activity.WorkOverviewActivity;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.TextView;

public class ProjectNameVerticalTextView extends TextView {

    public ProjectNameVerticalTextView(Context context) {
	super(context);
    }

    public ProjectNameVerticalTextView(Context context, AttributeSet attrs) {
	super(context, attrs);
    }

    public ProjectNameVerticalTextView(Context context, AttributeSet attrs,
	    int defStyle) {
	super(context, attrs, defStyle);
    }

    protected void onDraw(Canvas canvas) {

	canvas.rotate(90, 0, dpToPixels(WorkOverviewActivity.PROJECT_NAME_ROTATION_Y));

	super.onDraw(canvas);

    }

    public int dpToPixels(int dipper) {
	return ((int) (dipper * getResources().getDisplayMetrics().density));
    }
}